package com.my.chapter3;

public class practice14 {
    public static void main(String[] args) {
        String s1 = "man";
        String s2 = "man";
        String s3 = "woman";
        compareString(s1,s2);
        compareString(s2,s3);
    }
    static void compareString(String s1,String s2){
        System.out.println("字符串1："+s1+"; 字符串2："+s2);
        System.out.println(s1==s2);
        System.out.println(s1!=s2);
        System.out.println(s1.equals(s2));
        System.out.println("-----------------");
    }
}
